﻿using System;

namespace _050_接口
{
    public interface IEnumerator
    {
        bool MoveNext();
        object Current { get; }
        void Reset();
    }

    internal class CountDown:IEnumerator
    {
        int count = 11;
        public bool MoveNext() { return count-- > 0; }
        public object Current { get { return count; } }
        public void Reset() { throw new NotSupportedException(); }
    }
    class Program
    {
        static void Main(string[] args)
        {
            IEnumerator e = new CountDown();
            while (e.MoveNext())
            {
                Console.Write(e.Current); // 109876543210
            }
        }
    }
}
